﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.IO;
using Component;
using System.Web.UI;
using DevExpress.Xpo;

namespace Component
{
    public class IntroductionImgDB :Base
    {
      
        public static XPCollection<IntroductionImg> GetAll()
        {
            XPCollection<IntroductionImg> _xpIntroductionImg = new XPCollection<IntroductionImg>(KetNoiCSDL.session);
            return _xpIntroductionImg;
        }
        public static Component.IntroductionImg  GetObjectByid(int id, bool admin)
        {
            XPCollection<IntroductionImg> _xpIntroductionImg = new XPCollection<IntroductionImg>(KetNoiCSDL.session);
            _xpIntroductionImg.Filter = FilterAll(admin);
            return _xpIntroductionImg.Lookup(id);
        }
        public static bool TestExistFile(string part)
        {
            XPCollection<IntroductionImg> _xpIntroductionImg = new XPCollection<IntroductionImg>(KetNoiCSDL.session);
            _xpIntroductionImg.Filter = FilterByString(ColumIntroductionImg._Path, part, true);
            if (_xpIntroductionImg.Count > 0)
          {
                return true;
            }
            return false;
        }
     
    }
}
